home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
music
/
188
/
pascal
/
pascalii.doc
< prev
next >
Wrap
Text File
|
1987-10-14
|
6KB
|
195 lines
Pascalii.prg
============
This is a shell that is designed to replace the shell program provided
with OSS's personal compiler. The basic functions of the new shell are the
same. The main advantage of my shell is that all the basic commands are
now single key-stroke executable. Following is a list of the menu entries
and their key equivalents. (if they exist)
Menu Name Key equivalent function
===================================================================
Edit E Edit the file that is currently
selected as the edit file. If no
current edit file then allows choice
of file.
Compile C Compile the file that is currently
selected as the compile file. If no
current compile file then allows
choice of file.
Link L Link the .o file that corresponds
to the selected compile file. The
next version will allow separate
link file selection.
Run R Run the program that is currently
selected as the run program. If no
current run file then allows choice
of file. If the program is a TOS
program then the screen is cleared,
the program is run, then waits for
a key to be pressed before restoring
the desk top.
File F Change the edit file.
Main M Change the compile file.
Active A Change the run file.
Quit Q Exit the shell.
Compiler Options None Select the compiler options.
Linker Options None Select the linker options. A
warning is needed here. Because
of GEMDOS limitations make sure
that the length of all the
additional files + 13 < 127.
Why can't they do it right?
Editor Options None This allows you to specify wether
your editor is GEM based or not.
If you use an editor that can be
customized with arguments then you
can specify them here. Ignore the
box about what kind of parameters
the editor takes.
Save Options None Save the options that you have
selected.
Make Path P Select the MAKEFILE.
Do Make D Do a make. See description of make
which follows.
Touch T Set the date of a file to the
current date.
Sleep a while None Put screen to sleep to prevent
burnin. Works best on Monochrome.
I just got color monitor so next
version will work for color.
Delete a file None Cooks your supper.
MAKE facility.
=============
Make is a facility written in order to allow better maintenance of
larger programing projects. If for example you have a project (like this
shell) that is written in a modular fashion then trying to remember what
files you have edited and need recompiling can become quite tedious. Make
will do this for you provided that you first det up a makefile. In this
file you will set up a set of dependencies. The format of the file is as
follows.
Any line begining with a # is ignored.
The first line can define the compile flags used for all the
compiles. If the first line of the file is FLAGS then the next line is
used as the flags. See the example make file that I've included at the
end of this document.
The rest of the file consists of sets of lines which consist of
a dependency line an a series of commands that need to be executed in
order to bring the dependent file up to date. The dependency line has the
following syntax.
FILENAME:<tab>file1,file2,file3,...,filen
Currently there is a limit of 20 critical files. (The files that
the dependent file depends on).
Each of the command lines that follow have to start with a tab
and then the command that is to be run. if you need to compile then
you can use the COMPILE command instead of typing in the full command
line. The COMPILE command assumes that you wish to compile the first
critical file.
If you need to link then use the LINK command. If the command
line starts with a .bat file then if that batch file exists then it is
run with the appropriate arguments taken from the rest of the command line.
(This was a last minute hack as I want to use this shell to port a couple
of c programs to the ST) (See later for the batch file format.)
If the command line is none of the above then the line is
simply executed.
The last line of the file that is parsed is a line that
only has the word END in upper case on it. (Both the Compile and
link commands have to be in upper case. Next version will change this)
Please be careful when using this as error checking is not
as good as it should (and hopefully will ) be.
COMPILER FLAGS
==============
The flags for the compiler are as follows.
/GEM Compile as a GEM program
/PAUSE Pause after errors
/DEBUG Full debug mode
/CHECK Perform Range checking
/NOCHECK Don't perform stack heap collision check.
/CLEAR Initialize variables.
I have never tried to specify a temporary directory but
I suspect that just giving the path name as an argument
will suffice. I will document this in the next version.
BATCH FILES
===========
A maximum of 9 arguments are allowed. Currently all that this
does is to substitute any argument place holder with the appropriate
argument. The palce holders are of the form %n where n is the number of
the argument. I do not know what will happen if you try to access an
argument that was not on the command line. (don't do it yet)
Also make sure that the last line does not have a line return. (this
is a new feature and will become more robust)
EXAMPLE MAKEFILE
================
#Notice that the program is the last set of dependencies. This is because
#this is a one pass make facility. Thus you have to make sure that all files
#depend on files that have been defined earlier. This should cause no
#problem exept if you have a preprocessor of some sort.
#
#Makefile for Pascalii.prg
#
# Programmed by john buchanan
#
FLAGS
/GEM /PAUSE /DEBUG /CHECK
#
#Compile the batch file stuff
#
batstuff.o: batstuff.pas
COMPILE
#
#Compile the tools file
#
pasctols.o: pasctols.pas
COMPILE
#
#Compile the make utility
#
pascmake.o: pascmake.pas
COMPILE
#
#compile the main program
#
pascalii.o: pascalii.pas
COMPILE
#
#Link the modules
#
pascalii.PRG: PASCALII.O,PASCMAKE.O,batstuff.o,PASCTOLS.O,PASGEM
LINK
END